<?php 
require '../home/config.php';
require_once '../classes/simple_html_dom.php';
$content = file_get_contents('http://www.nchmf.gov.vn/web/vi-VN/81/Default.aspx');

$strBegin 	= '<tr class="thoitiet_hientai">';
$strEnd 	= '<!-- Botton -->';

$pos1 = strpos($content, $strBegin);

if(false === $pos1) {
	echo '';
}
else {
	$pos2 = strpos($content, $strEnd);
	$content = substr($content, $pos1, ($pos2-$pos1));
	$content = strip_tags($content, '<table><tr><td><img>');
    $pos3 = strpos($content,'</table>');
    $content = substr($content, $pos3);
    
    $html = str_get_html($content);
    foreach($html->find('td[class=thoitiet_hientai]') as $element) {
        echo $element->innertext();
    }
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>VnUpdate.net - Tin tức cập nhật</title>
</head>
<body>
<?php
    //echo '<div class="thoitiet">';
    //echo $content;
    //echo '</div>';
    //echo $title->innertext();
?>
</body>
</html>